package com.ruicar.afs.cloud.channel.register.controller;


import com.ruicar.afs.cloud.channel.online.entity.ChannelBaseInfoTemp;
import com.ruicar.afs.cloud.channel.online.service.ChannelOnlineService;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/channelBaseInfo")
@Api(value = "channelBaseInfo", description = "合作商模块")
public class ChannelBaseInfoController {

    private ChannelOnlineService channelOnlineService;

    /**
     * 此方法查询所有的合作商名称
     *
     * @return
     */
    @RequestMapping(value = "/getBaseInfo", method = RequestMethod.POST)
    @ApiOperation(value = "查询")
    public IResponse<List<ChannelBaseInfoTemp>> getAll() {
        List<ChannelBaseInfoTemp> list = channelOnlineService.list();
        return new IResponse<List<ChannelBaseInfoTemp>>().setData(list);
    }
}
